package inventoryServe.service.impl;


import inventoryServe.mapper.InventoryMapper;
import inventoryServe.po.Inventory;
import inventoryServe.service.InventoryService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;

@Service
@Transactional
public class InventoryServiceImpl implements InventoryService {
    // 注解注入
    @Autowired
    private InventoryMapper inventoryMapper;

    @Override
    public List<Inventory> allInventory(Inventory inventory) {
        System.out.println("allInventory 服务层");

        return this.inventoryMapper.allInventory(inventory);
    }

    @Override
    public Boolean addInventory(Inventory inventory) {

        return this.inventoryMapper.addInventory(inventory) > 0;
    }

    @Override
    public List<Inventory> inventoryOfStore(Inventory inventory) {
        return this.inventoryMapper.inventoryOfStore(inventory);
    }
}
